<script language="javascript">
function passwordChanged() {
var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[!@#$>%^<&_=-]).*$", "g");
var pwd = document.getElementById("password").value;
alert(pwd);
if (!strongRegex.test(pwd)) {
alert("Invalid password");
return false;
}
else{
alert("Valid password");
return false;
}
}
</script>
<input name="password" id="password" type="text" size="15" maxlength="20" />
<input type="button" value="click" onclick="passwordChanged();" />
<span id="strength">Type Password</span>
